<?php
require_once '../ptnhuan-web1/libraries/utilites/functions.php';
$path = "../ptnhuan-web1/data/films.txt";
$full_path = realpath($path);
$films = mreadFile($path);
$rating = NULL;
?>
<?php foreach ($films as $film): ?>
    <?php
    $film = trim($film);
    if (!empty($film)):
        ?>
        <?php $mfil = explode(";", $film); ?>
        <?php if (isset($_GET['uid'])): ?>
            <?php if ((int) $_GET['uid'] != 0): ?>
                <?php if ((int) $_GET['uid'] == (int) $mfil[4]): ?>
                    <?php echo $mfil[0] ?>
                    <img src='../../ptnhuan-web1//public/images/films/<?php echo $mfil[1] ?>'>
                    <?php echo $mfil[2] ?>
                    <?php echo $mfil[3] ?>
                     <?php echo $mfil[4] ?>
                    <a href=edit.php?if=<?php echo $mfil[0]; ?>>edit</a><br>
                <?php endif; ?>     
            <?php else :?> 
                <img src='../../ptnhuan-web1//public/images/films/<?php echo $mfil[1] ?>'>
                <?php echo $mfil[2] ?>
                <?php echo $mfil[3] ?>
                <?php echo $mfil[4] ?>
                <a href=edit.php?if=<?php echo $mfil[0]; ?>>edit</a><br>    
        <?php endif; ?>  
    <?php endif; ?> 
 <?php endif; ?>  
<?php endforeach; ?>

                

